﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Areas/admin/Views/Shared/Create.Master"
    Inherits="System.Web.Mvc.ViewPage<Longtop.Web.SaleWeb.Admin.Sales.CreateModel>" %>

<asp:Content ContentPlaceHolderID="Scripts" runat="server" ID="Content2">
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <tr>
        <td>
        </td>
        <td>
            <%= Html.ValidationSummary()%>
        </td>
    </tr>
    <tr>
        <td>
            <%= Html.LabelFor(model=>model.Model.UserName) %>
        </td>
        <td>
            <%= Model.Model.UserName%>
        </td>
    </tr>
    <tr>
        <td>
            <%= Html.LabelFor(model=>model.Model.Departments) %>
        </td>
        <td>
            <%var roles = Role.GetAll();
              foreach (var r in roles) {
                  var index = roles.IndexOf(r);
            %>
            <label>
                <input name="Roles[<%= index%>].Rolename" type="checkbox" value="<%=r.Rolename%>,true"
                    <%= (Model.Model != null && Model.Model.Roles != null && Model.Model.Roles.ToList().Exists(x => x == r))?"checked='checked'":"" %> />
                <%=r.Rolename %>
                <input type="hidden" value="<%=r.Rolename %>,false" name="Roles[<%= index%>].Rolename" />
            </label>  <%} %>
        </td>
       
    </tr>
</asp:Content>
